package demo2;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 测试Spring在创建对象时基于@Value注解为属性初始化
 */
public class Demo {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context
                = new AnnotationConfigApplicationContext("demo2");
        UserDAO userDAO = context.getBean(UserDAO.class);
        System.out.println(userDAO);

        Person person = context.getBean(Person.class);
        System.out.println(person);
    }
}



